package cn.wolfcode.advice;

import cn.wolfcode.domain.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.sql.SQLIntegrityConstraintViolationException;

@RestControllerAdvice
public class UniteExceptionHandler {
    @ExceptionHandler(SQLIntegrityConstraintViolationException.class)
    public Result ex(SQLIntegrityConstraintViolationException e){
        return Result.error("操作失败，请联系龙哥");
    }
}
